﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="WUCSpotlightedArt.ascx.cs" Inherits="WebAppArtreve.views.shared.components.arts.WUCSpotlightedArt" %>
<%@ Register src="WUCArtImage.ascx" tagname="WUCArtImage" tagprefix="uc1" %>
<h3>Spotlighted Art</h3>    
<asp:ListView ID="ListViewSpotlightedArts" runat="server"
DataSourceID="ODSArtsALLSpotlighted" 
    onitemdatabound="ListViewSpotlightedArts_ItemDataBound" >
    <LayoutTemplate>
        <article id="itemPlaceholder" runat="server" />
        <asp:DataPager runat="server" ID="ArtsSpotlighedDataPager" PageSize="3">
          <Fields>
            <asp:TemplatePagerField>
              <PagerTemplate>
                &nbsp;
                <asp:TextBox ID="CurrentRowTextBox" runat="server"
                     AutoPostBack="true"
                     Text="<%# Container.StartRowIndex + 1%>" 
                     Columns="1" 
                     style="text-align:right" 
                     OnTextChanged="CurrentRowTextBox_OnTextChanged" />
                to
                <asp:Label ID="PageSizeLabel" runat="server" Font-Bold="true"
                     Text="<%# Container.StartRowIndex + Container.PageSize > Container.TotalRowCount ? Container.TotalRowCount : Container.StartRowIndex + Container.PageSize %>" />
                of
                <asp:Label ID="TotalRowsLabel" runat="server" Font-Bold="true"
                     Text="<%# Container.TotalRowCount %>" />
              </PagerTemplate>
            </asp:TemplatePagerField>
            <asp:NextPreviousPagerField 
                 ShowFirstPageButton="true" ShowLastPageButton="true"
                 FirstPageText="|<< " LastPageText=" >>|"
                 NextPageText=" > " PreviousPageText=" < " />
          </Fields>
        </asp:DataPager>
    </LayoutTemplate>
    <ItemTemplate>
        <article class="ListViewArtArticle">        
            <section class="art-image">
            <!-- in asp controller kan je eval enkel doen met enkele haakjes -->
            <a href="Art.aspx?id=<%# Eval("Id")%>">
                <uc1:WUCArtImage ArtId='<%# Eval("Id")%>' ID="WUCArtImage1" runat="server" />
            </a>
            </section>
            <header>
            <a href="Art.aspx?id=<%# Eval("Id")%>">
                <h3><%# Eval("Name") %></h3>
            </a>
                <section class="article-info">
                </section>            
            </header> 
            <section class="art-description">
            </section>        
        </article>
    </ItemTemplate>
</asp:ListView>
<asp:ObjectDataSource ID="ODSArtsALLSpotlighted" 
    runat="server" 
    TypeName="CLibArtreve.bll.ArtBLL"
    DataObjectTypeName="CLibArtreve.models.Art"  
    SelectMethod="GetAllSpotlightedArts"
    OnObjectCreating="ODSArtsALLSpotlighted_OnObjectCreating">
</asp:ObjectDataSource>

